<?php
session_start();

include_once("../../Misc.php");
include_once("../../helpers/CHtml.php");
include_once("../../helpers/CJavascript.php");
include_once("../../helpers/Composer.php");
include_once("../../classCol/classOracleDb.php");
include_once("../models/fetchers.php");

$srcDbCbCode = "MST_CASH_BANK";

$GHtml      = new CGHtml;
$GJs        = new CGJavascript;
$Misc       = new Misc;

$CLFetchers = new CLFetchers;

$Db = new oracleDb;
$Db->init($_SESSION["ORCL"],
          $_SESSION["OPASS"],
          $_SESSION["SID"],
          _NO_COMMENT);

if($Db->connect()){

  /**
   * if isList
   * means get list
   * else
   * means get name
   */
  if($_POST["isList"]){

    $CLFetchers->fetchLstCbCode($Db,
                                $srcDbCbCode,
                                $nCbCode,
                                $lstCbCode);

    $GHtml->initDropDownContent($lstCbCode["C_B_CODE"],
                                $_POST["cbCode"],
                                $retContent);

    echo  $retContent;
  }else{

    $CLFetchers->fetchCbName($Db,
                             $_POST["cbCode"],
                             $srcDbCbCode,
                             $cbName);

    echo  $cbName;
  }

  $Db->dc();
}else{

  $Misc->usrDieJs(_DB_CONN_ERROR);
}

?>
